package com.hxgz.steel.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel(value="商品对象模型")
public class Product {
    @ApiModelProperty(value="商品id",required = true)
    private Long id;
    @ApiModelProperty(value = "类别",required = true)
    private Integer categoryId;
    @ApiModelProperty("商家id")
    private Long merchantId;
    @ApiModelProperty(value = "商品名称",required = true)
    private String name;
    @ApiModelProperty(value = "商品材质",required = true)
    private String materials;
    @ApiModelProperty(value = "商品简介",required = true)
    private String subtitle;
    @ApiModelProperty(value = "产品主图url",required = true)
    private String mainImage;

    @ApiModelProperty("库存数量")
    private Integer stock;
    @ApiModelProperty(value = "商品状态.1-在售 2-下架 3-删除",required = true)
    private Integer status;
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    @ApiModelProperty(value = "商品编号")
    private String productCode;
    @ApiModelProperty(value = "税点（购买单个商品的税点）",required = true)
    private BigDecimal taxPoint;
    @ApiModelProperty(value = "运费",required = true)
    private BigDecimal freight;
    @ApiModelProperty(value = "运费状态 0-(一个商品一个运费) 1-总运费(一种商品一个运费)",required = true)
    private Integer freightStatus;
    @ApiModelProperty(value = "特性",required = true)
    private String features;

    @ApiModelProperty(value = "商品类目", required = true)
    private String productCate;

    @ApiModelProperty("用户")
    @javax.persistence.Transient
    private Long userId;
    @ApiModelProperty("销量")
    private Integer totalSale;

    @ApiModelProperty("评分")
    private BigDecimal grade;

    @ApiModelProperty("评分数")
    private Integer gradeCount;

    @ApiModelProperty("品名")
    private String topName;

    @ApiModelProperty("品名id")
    private Integer topNameId;

    @ApiModelProperty("商品名称id (为空时代表用户手填商品名称)")
    private Integer nameId;

    @ApiModelProperty("商品材质id")
    private Integer materialsId;

    @ApiModelProperty("特性id")
    private Integer featuresId;

    @ApiModelProperty("单位")
    private String unit;
    @Transient
    private String imgs;
}